<template>
  <div class="personalCenter_container main_container">
    <div class="main_header">
      <div class="padding_container">
        <div class="left">个人中心</div>
        <div class="right" />
      </div>
    </div>
    <div class="main_main">
      <div class="card card_shadow">
        <PersonalAccount />
      </div>
      <div v-if="codeStatus" class="card_info card_shadow">
        <PersonalInfo />
      </div>
    </div>
  </div>

</template>

<script>
import AvatarUpload from './components/AvatarUpload'
import ChangePassword from './components/ChangePassword'
import PersonalAccount from './components/personalCenter/PersonalAccount'
import PersonalInfo from './components/personalCenter/PersonalInfo'
import { getPool } from '@/api/common/common'
export default {
  name: 'PersonalCenter',
  components: {
    AvatarUpload, ChangePassword, PersonalAccount, PersonalInfo
  },
  data() {
    return {
      codeStatus: ''
    }
  },
  mounted() {
    this.codeStatus = this.$store.state.user.codeStatus

    this.getPool()
  },
  methods: {
    getPool() {
      getPool(this.$store.state.user.companyId).then(res => {
        this.$store.dispatch('user/getPointsCashStatus', res.data.pointsCashStatus)
        this.$store.dispatch('user/getPointsGetStatus', res.data.pointsGetStatus)
      })
    }
  }
}
</script>

<style lang="less" scoped>
.personalCenter_container{
  width: 100%;
  height: 100%;
  .card{
    width: 400px;height: calc(100% - 20px);
    margin-left: 10px;
    // margin-top: 10px;
    display: flex;flex-direction: column;

    .card1_header{
      display: flex;justify-content: flex-start;align-items: center;
    }
    /deep/ .el-card__body{
      flex: 1;
      .AvatarUpload{
        display: flex;flex-direction: column;justify-content: space-between;
        .avatar{
          justify-content: space-between;
        }
      }
    }
  }
  .card_info{
    height: calc(100% - 20px);
    margin-left: 10px;
    // margin-top: 10px;
    width: calc(100% - 430px);
  }
  .main_header{
    color: #606266;
    .left{
      padding-left:10px;
    }
  }
}
</style>
<style scoped>
.card1 >>> .el-card__header{
  padding-left: 20px;
  height: 50px;
  display: flex;align-items: center;
}
</style>
<style lang="less" scoped>
.card_shadow{
  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
  border-radius: 16px !important;
}
.main_main{
  height: calc(100% - 70px);
  background: unset;
  flex-direction: row;
  .card2{
    width: 400px;
  }
  /deep/ .el-card__body{
    padding: 0;
  }
}
</style>
